import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  name = '小明';
  indexId = '1';
  nId;
  ngOnInit() {
    this.indexId = sessionStorage.getItem('nId');
    // sessionStorage.removeItem('nId');
  }
  articleType(id) {
    this.indexId = id;
    this.nId = sessionStorage.setItem('nId', id);
  }
}
